#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include<QPushButton>
#include<QTime>
#include<QPainter>
#include<QRandomGenerator>
#include<QtMath>
#include<QKeyEvent>
#include<QMessageBox>
#include <QTimer>
namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget* parent = nullptr);
    ~MainWindow();
    void paintEvent(QPaintEvent*);
    void keyPressEvent(QKeyEvent* event);

    QPushButton* button;
    int s[4][4];
    int score = 0;
    bool state;

    void PressUp();
    void PressDown();
    void PressLeft();
    void PressRight();
    void myRand();
    struct Ns {
        int i;
        int j;
    };
public slots:
    void slotStart();
private:
    Ui::MainWindow* ui;
    struct BlockAnimation {
        QPointF startPos;
        QPointF endPos;
        int value;
        qreal progress;
        bool merged;
    };
    QList<BlockAnimation> animations;
    QTimer* animTimer;
    bool isAnimating; 
};
#endif 
